package com.situ.layuimini.service.impl;

import com.situ.layuimini.entity.Menu;
import com.situ.layuimini.mapper.MenuMapper;
import com.situ.layuimini.service.IMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.situ.layuimini.vo.InitMenuVO;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author kkkkkk
 * @since 2022-06-01
 */
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IMenuService {

    @Override
    public InitMenuVO init() {
        InitMenuVO vo = new InitMenuVO();
        Map<String, String> home = new HashMap<>();
        home.put("title", "首页");
        home.put("href", "");
        vo.setHomeInfo(home);
        Map<String, String> logo = new HashMap<>();
        logo.put("title", "后台管理系统");
        logo.put("image", "images/logo.png");
        logo.put("href", "");
        vo.setLogoInfo(logo);
        vo.setMenuInfo(baseMapper.selectInitMenu(0));
        return vo;
    }
}
